package cn.iocoder.yudao.module.wms.dal.mysql.batch;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.wms.controller.admin.batch.vo.BatchPageReqVO;
import cn.iocoder.yudao.module.wms.dal.dataobject.batch.BatchDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 批号设置 Mapper
 *
 * @author 曾劲松
 */
@Mapper
public interface BatchMapper extends BaseMapperX<BatchDO> {

    default PageResult<BatchDO> selectPage(BatchPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BatchDO>()
                .likeIfPresent(BatchDO::getFname, reqVO.getFname())
                .likeIfPresent(BatchDO::getTname, reqVO.getTname())
                .eqIfPresent(BatchDO::getSname, reqVO.getSname())
                .betweenIfPresent(BatchDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BatchDO::getId));
    }

}